package com.ifonly.activerecord.common;

import java.util.List;

/**
 * @author <a href="mailto:ifonlymaster@163.com">ifonly</a>
 * @version 1.0 2015-12-06 23:11
 * @since JDK 1.6
 */
public class Pagination<E> {

    private int pageNumber;
    private int pageSize;
    private long totalRecords;
    private List<E> records;

    public Pagination() {
    }

    public Pagination(long totalRecords, List<E> records) {
        this.totalRecords = totalRecords;
        this.records = records;
    }

    public Pagination(int pageNumber, long totalRecords, List<E> records) {
        this.pageNumber = pageNumber;
        this.totalRecords = totalRecords;
        this.records = records;
    }

    public Pagination(int pageNumber, int pageSize, long totalRecords, List<E> records) {
        this.pageNumber = pageNumber;
        this.pageSize = pageSize;
        this.totalRecords = totalRecords;
        this.records = records;
    }

    public int getPageNumber() {
        return pageNumber;
    }

    public void setPageNumber(int pageNumber) {
        this.pageNumber = pageNumber;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public long getTotalRecords() {
        return totalRecords;
    }

    public void setTotalRecords(long totalRecords) {
        this.totalRecords = totalRecords;
    }

    public List<E> getRecords() {
        return records;
    }

    public void setRecords(List<E> records) {
        this.records = records;
    }

    @Override
    public String toString() {
        return "Pagination{" +
                "pageNumber=" + pageNumber +
                ", pageSize=" + pageSize +
                ", totalRecords=" + totalRecords +
                ", records=" + records +
                '}';
    }
}
